﻿package com
{
	import flash.external.ExternalInterface;

	public class Js {
		public var param:Object;
		private var is_debug:Boolean;
		public function Js(parameters:Object,debug:Boolean) {
			
			is_debug = debug;
			if (!is_debug) {
				param = parameters;
			}
		}
		public function expandjs():void {
			if (!is_debug) {
				var expand:String = param['expand']?param['expand']:"expand";
				if(ExternalInterface.available)
				ExternalInterface.call(expand);
			}
		}
		public function collapsejs():void {
			if (!is_debug) {
				var collapse:String = param['collapse']?param['collapse']:"collapse";
			if(ExternalInterface.available)
			ExternalInterface.call(collapse);
			}
		}
		public function closejs():void {
			if (!is_debug) {
				var closejs:String = param['close']?param['close']:"close";
			if(ExternalInterface.available)
			ExternalInterface.call(closejs);
			}
		}
		public static function debug(s:String):void {
			trace(s);
			if(ExternalInterface.available)
			{
				ExternalInterface.call("console.log", s);
				//ExternalInterface.call("alert",s);
			}
			
			
		}
		
	}
}